<SCRIPT language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
</SCRIPT>
<?
session_start();
if(!isset($_SESSION['loggedon'])){
	echo "<script>window.location='index.php'</script>";
}
if(isset($_GET['del'])){
	unlink($_GET['del']);
}
if(isset($_FILES["file"])){
	chmod("./",0777);
	$arquivo=$_FILES["file"]["name"];
	$tmp=$_FILES["file"]["tmp_name"];
	@copy($tmp,$arquivo);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form name="form1" enctype="multipart/form-data" method="post" action="">
  <input type="file" name="file">
  <br>
  <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
<?
$dir=opendir("./");
while($arquivos=readdir($dir)){
	if($arquivos == "." or $arquivos == "..") continue; {
		echo "<a href=file.php?del=$arquivos>$arquivos</a><br>";
	}
}

?>